//https://www.cnblogs.com/Shyno/p/15222897.html
const chalk = require('chalk')
const inquirer = require('inquirer')
const name = process.argv.slice(3)[0];
const promptList = [
  {
    type:'input',
    name:"projectName",
    message:'你的项目名称为',
    default:name,
    validate:(value)=>{
      if(value === ''){
        console.log(chalk.red.bold('无名氏'));
        return false
      }else{
        return true
      }
    }
  },
  {
    type:'list',
    name:'type',
    message:'你想要创建哪种类型的项目',
    choices:[
     'ts',
     'js',
     'app'
    ],
  },
  {
    type:'password',
    name:'keyword',
    message:'项目的认证关键词是',
    prefix:'重要>>>>>',
    suffix:':'
},
]

module.exports = ()=>{
  return inquirer.prompt(promptList)
}